package stringFun;

public class stringApi {
    public static void main(String[] args) {
         //直接赋值
        String name = "zhangsan";
        //new对象
        String name1 = new String();//name = ""
        char[] chars = {'a','b','c'};
        String name2 = new String(chars);
        System.out.println(name2); //abc
        byte[] bytes = {97,98,99};//转为 ASCII码
        String name3 = new String(bytes);
        System.out.println(name3); //abc
    }
}
